Release 10.1A: OpenEdge Development:
Progress 4GL Reference
QUERY-OFF-END function
Returns a logical value indicating whether the specified query is positioned at the end of its result list (either before the first record or after the last record).
Syntax
query-nameA character expression that evaluates to the name of a currently open query. If
Note: Searching for a query using a handle is more efficient than a character expression. Progress resolves a character expression at runtime by searching in the current routine for a static query with that name. If not found, Progress searches the enclosing main procedure. If still not found, Progress searches up through the calling programs of the current routine, and their main procedures. Since a handle uniquely identifies a query, no such search is required. Use the query object handle’s QUERY-OFF-END attribute to avoid a runtime search. Examplequery-namedoes not resolve to the name of a query, or if the query is not open, then the function returns the Unknown value (?).The following example uses the QUERY-OFF-END function to determine when to leave the REPEAT loop:
When you run this procedure, all customer numbers and names are displayed. After the last record is displayed, the loop iterates and the GET NEXT statement reads beyond the last record. At this point QUERY-OFF-END returns TRUE and Progress exits the loop.
Note
To test whether a GET statement read beyond the last (or first) record pass a buffer to the AVAILABLE function. The QUERY-OFF-END function serves the same purpose, but does not require a specific buffer; it requires only a query name.
See also
CLOSE QUERY statement, CURRENT-RESULT-ROW function, DEFINE BROWSE statement, DEFINE QUERY statement, GET statement, NUM-RESULTS function, OPEN QUERY statement, QUERY-OFF-END attribute, REPOSITION statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |